// 问题列表
var problemColumns = [
  {
    id: 'createTime',
    title: '提交时间',
    type: 'date',
    width: 100,
    format:'yyyy-MM-dd',
    otype:'time_stamp_ms',
    columnClass: 'text-center'
  },
  {
    id: 'createUser',
    title: '提交人',
    width: 75,
    type: 'string',
    columnClass: 'text-center'
  },
    {
        id: 'fromName',
        title: '来源项目',
        type: 'string',
        width: 150,
        columnClass: 'text-center'
    },
    {
        id: 'delName',
        title: '接收项目',
        type: 'string',
        width: 150,
        columnClass: 'text-center'
    },
  {
    id: 'prbLevel',
    title: '优先级',
    type: 'string',
    width: 60,
    columnClass: 'text-center',
    resolution: function (value) {
        var content = '';
        if (value == 1) {
            content += '低';
        }
        if (value == 2) {
            content += '中';
        }
        if (value == 3) {
            content += '高';
        }
        return content;
    }
  },
  {
    id: 'version',
    title: '基本版本号',
    type: 'string',
    width: 90,
    columnClass: 'text-center'
  },
  {
    id: 'prbDesc',
    title: '问题描述',
    type: 'string',
    columnClass: 'text-left'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 60,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-primary" onclick="ckprobleam(\'' + record.processId + '\')"><i class="icon-eye-open"></i>  查看</button>';
      return content;
    }
  }
];
function findProblem(CertusJsonAjax) {
    CertusJsonAjax.dataInit("findProblemList",{},problemColumns,'problemContainer','problemToolBarContainer');
}

function ckprobleam(id) {
    location.href="#/ckprobleam/"+id;
}

// 处理问题
function editproblem(id, problemType) {
  if (problemType == 1) {
    window.location.href = "../../project/edit/edit-problem-1.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 2) {
    window.location.href = "../../project/edit/edit-problem-2.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 3) {
    window.location.href = "../../project/edit/edit-problem-3.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 4) {
    window.location.href = "../../project/edit/edit-problem-4.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 5) {
    window.location.href = "../../project/edit/edit-problem-5.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 6) {
    window.location.href = "../../project/edit/edit-problem-6.html" + '?id=' + id + '&problemType=' + problemType;
  }
}
